<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // 自定义构造函数
        function XCow(name,age,weight,sex) {
            this.name = name,
            this.age = age,
            this.weight = weight,
            this.sex = sex,
            this.sing =  function () {
                console.log('会唱歌');
            }
            this.running = function () {
                console.log('会跑步');
            }
        }
        XCow.prototype.dance = function () {
            console.log('跳舞');
        }
        XCow.prototype.stature = '1米';
        // 实例化 自定义构造函数
        var xiNiu = new XCow('犀牛',3,'3000kg','男');
        xiNiu.dance();
    </script> 
</body>
</html>